home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / pock41.zip / DEMO.BAT < prev    next >
DOS Batch File  |  1994-06-01  |  14KB  |  397 lines

  1. echo off
  2. cls
  3. d    /Yny// /'//@tThis is a DEMO for the program D.EXE (&WPocketD&w)//@tDo you want to proceed (Y@/N) ?'
  4. if not errorlevel 2 goto fin
  5. echo  This demonstration shows a small sample of D.EXE's features. The user is
  6. echo  advised to run MENUD.EXE for a complete interactive demonstration of the
  7. echo  full range of features, and to run README for illustrative examples.                     
  8. echo  All files other than the original PocketD release files will be ignored.
  9. echo  D.EXE's internal screen size is set to 80 cols by 11 rows for demonstration
  10. echo  purposes. ( The menus below are all directly controlled by D.EXE ).
  11. set d_opt2=/#80,11p:.d.exe /:.d.exe/- wh* .pcx
  12. set _=1
  13. if "%_%"=="1" goto envok
  14. echo Not enough environment space!
  15. goto fin1
  16. :envok
  17. d    /@n
  18. if errorlevel 21 goto main2
  19. echo Sorry! Demo requires full installation!
  20. goto fin1
  21.  
  22. :main
  23. cls
  24. echo Returning to main menu..
  25. :main2
  26. d    /Y_12345 /'//@t1. Directory formats/@t2. Template/@t3. File information/@t4. File selection/@t5. Help//@tESC exit//@t?'
  27. if errorlevel 6 goto help
  28. if errorlevel 5 goto select
  29. if errorlevel 4 goto stats
  30. if errorlevel 3 goto templ
  31. if errorlevel 2 goto disp
  32. goto exit
  33.  
  34. :disp
  35. cls
  36. d    /Y1234 /'//@tChoose://@t1. Normal,@/w,@/m and @/t format/@t2. Bestfit/@t3. Subdir summary/@t4. Tailoring//@tESC cancel//@t?'
  37. cls
  38. if errorlevel 4 goto tail
  39. if errorlevel 3 goto subdir
  40. if errorlevel 2 goto bestfit
  41. if errorlevel 1 goto wmt
  42. goto main
  43.  
  44. :wmt
  45. echo This is the default format: standard details sorted by file/dir name            
  46. echo     D                                            
  47. d    /K.31
  48. echo.
  49. pause
  50. cls
  51. echo This is the /w "wide" format giving only filename and size in KBytes                                    
  52. echo     D /w                                            
  53. d    /w
  54. echo.
  55. pause
  56. cls
  57. echo This is the /m "minimum" format giving only the filename                                
  58. echo     D /m                                            
  59. d    /m
  60. echo.
  61. pause
  62. cls
  63. echo This is the /t "tiny" format grouping files by extension                                        
  64. echo     D /t                                            
  65. d    /t
  66. echo.
  67. pause
  68. goto disp
  69.  
  70. :bestfit
  71. echo This is the "Best-fit" format which automatically chooses the display format.
  72. echo In this case /w format is chosen to fit the 80x11 format used by the demo.            
  73. echo     D /b                                        
  74. d    /b~.20
  75. echo.
  76. pause
  77. cls
  78. echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
  79. echo In this case the layout is altered to 3 columns which still fits inside 11 rows.        
  80. echo      D /b/.k                                            
  81. d    /b~.20/.k
  82. echo.
  83. pause
  84. goto disp
  85.  
  86. :subdir
  87. echo This demonstrates some of the subdirectory summary features of PocketD
  88. d    /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
  89. if not errorlevel 2 goto disp
  90. echo      D N*.BAT D*.BAT /cc ATEMP1         ( command used for copy/create )        
  91. d    n*.bat d*.bat /cc atemp1 
  92. echo.
  93. md atemp2
  94. echo Subdirs ATEMP1 and ATEMP2 created                                
  95. pause
  96. cls
  97. echo The following uses /r to include a summary of the contents of subdir ATEMP1
  98. echo and ATEMP2
  99. echo     D /r                                            
  100. d    /rK.28
  101. echo.
  102. pause
  103. cls
  104. echo The following uses /S and /G to group contents of subdirs                    
  105. echo     D /wSG                                        
  106. d    .\AT* *.* /wSG~.35
  107. echo.
  108. pause
  109. cls
  110. d    /Y// /'//Deleting temporary files.'
  111. echo     D  atemp1 atemp2 /zd        ( command used to delete )                
  112. d    atemp1 atemp2 /Ihzd
  113. echo.
  114. pause
  115. goto disp
  116.  
  117. :tail
  118. echo PocketD offers 19 tailoring options. The following shows four of these:        
  119. echo 1. Unbroken names   2. 1jan91 date format   3. Lowercase   4. Sorting by row            
  120. echo     D /.umlr                                        
  121. d    /.umlr/~.28
  122. echo.
  123. pause
  124. goto disp
  125.  
  126. :templ
  127. cls
  128. echo PocketD has a very powerful TEMPLATE facility that can be used for display
  129. echo or execution purposes. It can accept 50 possible parameters, a few shown below.
  130. d    /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
  131. cls
  132. if errorlevel 2 goto t_exec
  133. if errorlevel 1 goto t_disp
  134. goto main
  135.  
  136. :t_disp
  137. echo The display template can be used in many ways. The simple example at the
  138. echo bottom of the screen simply outputs an X for each matching file/dir.            
  139. echo     D /w                                        
  140. d    /w
  141. echo.                                            
  142. echo     D [X]                                        
  143. d    [X]
  144. echo.
  145. pause
  146. cls
  147. echo The template can accept parameters such as $f giving the filename            
  148. echo     D [$f ]                                        
  149. d    [$f ]
  150. echo.
  151. echo.
  152. echo It can also accept formatted field widths e.g. $16f for padding to width 16        
  153. echo     D [$16f]                                    
  154. d    [$16f]
  155. echo.
  156. pause
  157. cls
  158. echo $10n gives only the name part without the extension, padded to width 10:            
  159. echo    D [$10n]                                        
  160. d    [$10n]
  161. echo.
  162. echo.
  163. echo "//" in the template will add a newline:                        
  164. echo     D ?????.* [$10n//]                                    
  165. d    ?????.* [$10n//]
  166. echo.
  167. pause
  168. goto templ
  169.  
  170. :t_exec
  171. echo PocketD can be used to run a template for a selected group of files. For
  172. echo example, the following could be used to move each file extension group to
  173. echo its own archive file. The $e option gives the extension part of the name.
  174. echo (R? below causes PocketD to echo each line without running it. R runs).        
  175. echo     D /e [PKZIP -m $e *.$e]R?                                
  176. d    /e [PKZIP -m $e *.$e]R?
  177. echo.
  178. pause
  179. cls
  180. echo PocketD can run multi-line sequences. e.g. To move each file extension
  181. echo group to its own subdir, named by the extension:                        
  182. echo     D /e [md $e//copy *.$e $e]R?
  183. D    /e [md $e//copy *.$e $e]R?!E- *.d*
  184. echo.
  185. pause
  186. cls
  187. echo PocketD can use separate templates for display and execution. This allows
  188. echo the user to browse the display template as a scrolling menu. In the example
  189. echo below $3# provides a file number, $F number of files, $d date, $t time, $s
  190. echo size. The 2nd template starts with [? indicating that it is a display template.
  191. echo The "((" template divider provides a section to appear for the 1st match only.
  192. echo The "Q" option turns the template into a menu (also allowing file viewing etc.).    
  193. echo    D [pkzip -m save $w][?  Choose from://(($3# of $F: $d $t $7s $13w Archive?]RQ            
  194. d    [  Choose from://(($3# of $F: $d $t $7s $13w Archive?]?~.10
  195. echo.
  196. pause
  197. cls
  198. echo PocketD can run alternative templates to give the user the choice of tasks.
  199. echo The example below allows the user to either move a file to an archive AND/OR
  200. echo copy it to drive A:. The user types "1" to execute the 1st template and "2"
  201. echo for the 2nd. This example could have used 2 display templates, giving 4 in all.    
  202. echo  D [pkzip -m save $w][copy $w A:][? $15w (1) Move to Archive (2) Copy to A:]QR        
  203.  
  204. D    [ $15w (1) Move to Archive (2) Copy to A:]?~.10
  205. echo.
  206. echo From this it can be seen that PocketD's templates potentially offer the user a
  207. echo great deal of power for file management. The user is recommended to follow
  208. echo the detailed examples given in the on-line guide, accessed by typing D /??
  209. pause
  210. goto templ
  211.  
  212. :stats
  213. cls
  214. echo PocketD can provide additional information about files and present file
  215. echo data in a number of ways. The following gives a few examples of this.
  216. d    /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size and Compression/@t3. Extension summary//@tESC cancel//@t?'
  217. cls
  218. if errorlevel 3 goto exten
  219. if errorlevel 2 goto exec
  220. if errorlevel 1 goto bar
  221. goto main
  222.  
  223. :bar
  224. echo The following chart show the relative size of all files represented as a
  225. echo bar chart. (only 1st 14 files shown).                            
  226. echo     D /g                                        
  227. d    /gK.14
  228. echo.
  229. pause
  230. cls
  231. echo The chart is improved by sorting the files by size (ss) & showing the relative
  232. echo percentage usage of each (%%). It also shows the size in terms of space used
  233. echo rather than actual size (U). If /r were added (and subdirectories were present)
  234. echo then the relative sizes of the subdirectories would be plotted.                    
  235. echo     D /ss /%%U /g       (or D /ss/%Ug- *.BAT etc..)                        
  236. d    /ss/%%UgK.13
  237. echo.
  238. pause
  239. goto stats
  240.  
  241. :exec
  242. echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
  243. echo Executable files can be compressed by PKLITE, DIET, COMPACK and LZEXE. The
  244. echo /C option shows which files are compressed by flagging as p,d,c or l        
  245. echo     D /EMC            ( E=executable  M=exec size  C=Compress check )            
  246. d    /EMC
  247. echo.
  248. pause
  249. goto stats
  250.  
  251. :exten
  252. echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
  253. echo to assess the space used by each ex